<template>
<el-dialog :append-to-body="true" :title="checkAccess.title" :visible.sync="checkAccess.show" width="1000px" :close-on-click-modal="false">
    <div class="assess-report">
        <template v-if="[2].includes(type)">
            <basic-index></basic-index>
            <graphical-display></graphical-display>
            <threshold-division></threshold-division>
            <div class="threshold-confusion">
                <confusion-matrix></confusion-matrix>
                <evaluation-index></evaluation-index>
            </div>
            <probability-count></probability-count>
        </template>
        <template v-if="[4].includes(type)">
            <basic-index></basic-index>
            <cluster-table></cluster-table>
            <pie-chart></pie-chart>
        </template>
        <template v-if="[5].includes(type)">
            <basic-index></basic-index>
            <visual-display></visual-display>
        </template>
        <!-- 交叉验证报告 -->
        <template v-if="[11].includes(type)">
            <cross-validation></cross-validation>
        </template>
        <!-- 自动调参报告 -->
        <template v-if="[21].includes(type)">
            <auto-param-table></auto-param-table>
            <model-evaluation></model-evaluation>
        </template>
    </div>
    <span slot="footer" class="dialog-footer"></span>
</el-dialog>
</template>

<script>
import AutoParamTable from '@/views/detail/assess/AutoParamTable'
import CrossValidation from '@/views/detail/assess/CrossValidation'
import ModelEvaluation from '@/views/detail/assess/ModelEvaluation'
import BasicIndex from '@/views/detail/assess/BasicIndex'
import EvaluationIndex from '@/views/detail/assess/EvaluationIndex'
import GraphicalDisplay from '@/views/detail/assess/GraphicalDisplay'
import ProbabilityCount from '@/views/detail/assess/ProbabilityCount'
import ThresholdDivision from '@/views/detail/assess/ThresholdDivision'
import VisualDisplay from '@/views/detail/assess/VisualDisplay'
import ConfusionMatrix from '@/views/detail/assess/ConfusionMatrix'
import PieChart from '@/views/detail/assess/PieChart'
import ClusterTable from '@/views/detail/assess/ClusterTable'
import { mapGetters } from 'vuex'

export default {
    name: 'CheckAssess',
    props: {
        checkAccess: {
            type: Object
        }
    },
    components: {
        BasicIndex,
        EvaluationIndex,
        GraphicalDisplay,
        ProbabilityCount,
        ThresholdDivision,
        VisualDisplay,
        ConfusionMatrix,
        PieChart,
        ClusterTable,
        ModelEvaluation,
        CrossValidation,
        AutoParamTable
    },
    computed: {
        ...mapGetters({
            modelDetail: 'common/getModelDetail'
        })
    },
    data () {
        return {
            type: null
        }
    },
    created () {
        this.type = this.modelDetail.summary.evaSummary.algorithmType
    }
}
</script>

<style lang="less">
.assess-report {
    .threshold-confusion {
        display: flex;
        margin-top: -70px;
    }
}
</style>
